// Learn JavaScript:
//  - Created by zhanghejun
// 	- creation time ：  2022-01-15
//  - 

cc.Class({
    extends: cc.Component,

    properties: {
        ui_hallBgSprite:cc.Sprite,

    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        // 更新背景
        this.updateHallBg();
    },
    onClick(event,ccustomEventDataus){

    },
    updateHallBg(){
        if (!cc.sys.localStorage.getItem("hall_bg_index")){
            cc.sys.localStorage.setItem("hall_bg_index",'bg');
        }
        cc.sys.localStorage.setItem("hall_bg_index",'bg');
        
        let bg_idx = cc.sys.localStorage.getItem("hall_bg_index");
        let img = `Texture/hall/${bg_idx}`;
        Global.CCHelper.updateSpriteFrame(img, this.hallBgSprite);
    }

});
